﻿using CPPEI.ETL.DataServiceInterface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.ETL.Domain.IntegrityCheck
{
    /// <summary>
    /// 数据完整性验证的接口
    /// </summary>
    public interface IIntegrityCheck
    {
        /// <summary>
        /// 验证是否完整
        /// </summary>
        /// <param name="data"></param>
        /// <param name="parameters"></param>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Validate(IData data, Dictionary<string, string> parameters, out string message);

        List<Parameter> EnumParameters();
        string GetConditionText(Dictionary<string, string> parameters);
    }
    public class Parameter
    {
        public string Name { get; set; }
        public Type Type { get; set; }
        public string Caption { get; set; }
        public string ValueString { get; set; }

        public Parameter(string name, string caption, Type type)
        {
            this.Name = name;
            this.Caption = caption;
            this.Type = type;
        }
    }
}
